package com.cc.seckill.dto;

import com.cc.seckill.entity.SuccessKill;
import com.cc.seckill.enums.SecKillStateEnum;

//封装秒杀执行后结果
public class SecKillExecution {

    private long secKillId;

//    秒杀执行结果状态
    private int state;

//    状态表示
    private String stateInfo;

//    秒杀成功返回的对象
    private SuccessKill successKill;

    @Override
    public String toString() {
        return "SecKillExecution{" +
                "secKillId=" + secKillId +
                ", state=" + state +
                ", stateInfo='" + stateInfo + '\'' +
                ", successKill=" + successKill +
                '}';
    }

    public SecKillExecution(long secKillId, SecKillStateEnum secKillStateEnum, SuccessKill successKill) {
        this.secKillId = secKillId;
        this.state = secKillStateEnum.getState();
        this.stateInfo = secKillStateEnum.getStateInfo();
        this.successKill = successKill;
    }


    public SecKillExecution(long secKillId,SecKillStateEnum secKillStateEnum) {
        this.secKillId = secKillId;
        this.state = secKillStateEnum.getState();
        this.stateInfo = secKillStateEnum.getStateInfo();
    }

    public long getSecKillId() {
        return secKillId;
    }

    public void setSecKillId(long secKillId) {
        this.secKillId = secKillId;
    }

    public int getState() {
        return state;
    }

    public void setState(int state) {
        this.state = state;
    }

    public String getStateInfo() {
        return stateInfo;
    }

    public void setStateInfo(String stateInfo) {
        this.stateInfo = stateInfo;
    }

    public SuccessKill getSuccessKill() {
        return successKill;
    }

    public void setSuccessKill(SuccessKill successKill) {
        this.successKill = successKill;
    }
}
